% TEST_ID: LANG-EXPAND-0048
% CATEGORY: language/reflection
% 测试 nargin 变量

function test_nargin
    assert(isequal(nargin, 0)); % Check nargin in the main function
    assert(isequal(test_utils, 0)); % Check nargin for test_utils
    assert(isequal(test_utils(1), 1)); % Check nargin with one argument
    assert(isequal(test_utils(1, 2), 2)); % Check nargin with two arguments
    assert(isequal(test_utils(1, 2, 3), 3)); % Check nargin with three arguments
    assert(isequal(test_utils(1, 2, 3, 4), 0)); % Check nargin with more than three arguments
end


function R = test_utils(x, y, z)
    if nargin == 1
        R = 1;
    elseif nargin == 2
        R = 2;
    elseif nargin == 3
        R = 3;
    else
        R = 0;
    end
end

